<?php
/**********************************************************
  eCode Marketing System
  Version 0.1
  Frontend Image Cache Fetcher (/get_coupon.php)
**********************************************************/

// Require configuration
define("FROMSCRIPT", true);
require_once(dirname(__FILE__)."/config.php");

$fname = CACHE_DIR . "/" . $_GET['campaign_id'] . "_" . $_GET['offer_id'] . ".png";

if(file_exists($fname)) {
	header("Content-Type: image/png");
	echo file_get_contents($fname);
} else {
	header("Status: 404 Not Found");
	exit;
}
?>